<template>
  <div class="preview-page">
    <iframe :src="previewUrl" width="100%" height="100%" v-if="pdfUrl"></iframe>
  </div>
</template>
 
<script>
export default {
  props: {
  
  },
  computed: {
    previewUrl() {
      let filePath = process.env.NODE_ENV === 'dev'?'/file/':''
      return window.location.origin + filePath + this.pdfUrl;
    },
  },
  data() {
    return {
      pdfUrl: null
    };
  },
  mounted() {
    this.pdfUrl = this.$route.query.pdfUrl;
  },
};
</script>
<style lang='less' scoped>
.preview-page{
  height: 100vh;
  width: 100%;
}
</style>